/*! \file BaseConfig.h
 *	\brief <write description for BaseConfig.h>
 *
 *	created:	2009/11/10
 *	created:	10:11:2009   17:44
 *	filename: 	c:\src\main\libs\config\BaseConfig.h
 *	file path:	c:\src\main\libs\config
 *	file base:	BaseConfig
 *	file ext:	h
 *	author:		Vitalii Trubchaninov
 *				venngraydog@gmail.com
 */

#ifndef _CONFIG_BASECONFIG_H_
#define _CONFIG_BASECONFIG_H_

#pragma once

#include "defs.h"

#include <core/Map.h>
#include <core/String.h>

namespace tt{
namespace config{

class /*CONFIG_API*/ BaseConfig
{
public:
	BaseConfig(void);
	virtual ~BaseConfig(void);

	void setInt(const String& key, Int value);
	Int getInt(const String& key, Int default_value = 0);

	void setUInt(const String& key, UInt value);
	UInt getUInt(const String& key, UInt default_value = 0);

	void setString(const String& key, const String& value);
	String getString(const String& key);
	const String& getString(const String& key, const String& default_value );

	void setBool(const String& key, bool value);
	bool getBool(const String& key, bool default_value = false );

private:
	virtual void onSetInt(const String& key, Int value) = 0;
	virtual Int onGetInt(const String& key, Int default_value) = 0;

	virtual void onSetUInt(const String& key, UInt value) = 0;
	virtual UInt onGetUInt(const String& key, UInt default_value) = 0;

	virtual void onSetString(const String& key, const String& value) = 0;
	virtual String onGetString(const String& key) = 0;
	virtual const String& onGetString(const String& key, const String& default_value ) = 0;

	virtual void onSetBool(const String& key, bool value) = 0;
	virtual bool onGetBool(const String& key, bool default_value) = 0;
};

} //namespace config
} //namespace tt

#endif //_CONFIG_BASECONFIG_H_
